import request from '@/utils/request'
// 角色管理列表
export const getRoleListApi = (params) => request({
  url: '/sys/role',
  params
})
// 新增角色
export const addRoleApi = (data) => request({
  url: '/sys/role',
  method: 'post',
  data
})
// 更新角色
export const updateRoleApi = (data) => request({
  url: `/sys/role/${data.id}`,
  method: 'put',
  data
})
// 删除角色
export const delRoleApi = (id) => request({
  url: `/sys/role/${id}`,
  method: 'delete'
})
// 获取角色详情
export const getRoleDetailApi = (id) => request({
  url: `/sys/role/${id}`
})
// 给角色分配权限
export const assignPermApi = (data) => request({
  url: '/sys/role/assignPrem',
  method: 'put',
  data
})
